package com.scs.application.modules.base.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.scs.application.core.query.QueryContext;
import com.scs.application.core.service.IBaseService;
import com.scs.application.modules.base.dto.MatrApplyDemandDTO;
import com.scs.application.modules.base.dto.SpChangeNameDTO;
import com.scs.application.modules.base.entity.Matr;
import com.scs.application.modules.base.entity.Supplier;
import com.scs.application.modules.sys.model.RestResult;
import com.scs.application.modules.wm.dto.DeliveryDTO;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 耗材信息 Service
 * </p>
 */

public interface MatrService extends IBaseService<Matr> {

    /**
     * 查询耗材信息（含耗材库存总量）
     * @return
     */
    List<Map> listWithStock(QueryContext queryContext);

    /**
     * 从MSCM系统中同步耗材
     */
    String syncMatrsFromMscm();


    /**
     * 保存上传的图片
     * @param file
     * @param matrId
     * @return
     */
    Map uploadPicture(MultipartFile file, String matrId);

    /**
     * 根据送货单明细取物料,給前台顯示图片地址
     * @param items
     * @return
     */
    List<Matr> getDeliverItemMatr(List<DeliveryDTO.DeliveryItemDTO> items);
    /**
     *
     * @description   查询耗材信息 科室需求业务
     * @param queryContext:
     * @return java.util.List<java.util.Map>
     * @throws
     **/
    List<Map> listWithDemand(QueryContext queryContext);

    Page<Map> pageWithStock(QueryContext context, Map<String, Object> userParam);

    String getMatrByMscmCode(String mscmCode);

    String  matrToMscm();

    RestResult matrOnceToMscm(List<String> idList);
    /**
     * 根据传过来的耗材ID列表和对应的业务类型通过后台业务禁用配置及耗材的禁用标志决定该业务的这些耗材能否放行
     * @param idList
     * @param businessType
     * @return
     */
    RestResult matrCanPass(List<String> idList, String businessType);


    IPage pageUsing(QueryContext queryContext);

    RestResult copyMatr(String id);

    Page<MatrApplyDemandDTO> pageWithStockForApplyDemand(QueryContext context, Map<String, Object> userParam);


    void updateTemporaryPurchase(List<String> items);

    Page pageInStock(QueryContext queryContext, Map<String, Object> userParam);

    Page pageForReportMatr(QueryContext queryContext, Map<String, Object> userParam);

    List<Map> getMatrWarehouseList();

    String excelImportForDataSplit(MultipartFile file, Map<String, String> reqData);

    String copyMatrBySpNameChange(SpChangeNameDTO changeParam, Supplier supplierNew,String remark);

    RestResult excelImportForDataImport(MultipartFile file, Map<String, String> reqData);
}
